﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

using OTA.Notification.BO.Event;
using OTA.Notification.Entity.Event;
using Strive.DataAccess.Base.BO;

namespace OTA.Notification.Web.Message
{
    public class MessageEventBO : MsgEventBO
    {

        protected override void ValidationRules()
        {
            //
        }
    }

    public partial class Message : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Request.QueryString["id"] != null)
                {
                    int iID = 0;
                    int.TryParse(Request.QueryString["id"], out iID);


                    InitPage();

                    BindData(iID);

                }
            }
        }


        private void InitPage()
        {

        }


        private void BindData(int ID)
        {
            using (MessageEventBO bo = new MessageEventBO())
            {
                MsgEventBean bean = bo.Load(ID);

                if (bean != null)
                {
                    lblAppCode.Text = bean.AppCode;
                    lblAppName.Text = bean.OrgCode;
                    lblClientTXSeq.Text = bean.ClientTxSeq;
                    lblCombo.Text = bean.Group.ToString();
                    lblCommand.Text = bean.TerminalCommand;
                    lblCreateTime.Text = bean.CreateTime.ToString();
                    lblDelay.Text = bean.Delay.ToString();
                    lblEventTime.Text = bean.MsgSendStartTime.ToString();

                    lblLastUpdateTime.Text = bean.LastUpdateTime.ToString();

                    lblLevel.Text = bean.Level;

                    lblMsgSendType.Text = bean.MsgSendType;

                    lblMsgTemplate.Text = bean.MsgTemplate;

                    txtMsgTitle.Text = bean.MsgTitle;
                    txtMsgContent.Text = bean.MsgContent;

                    lblMsgType.Text = bean.MsgType;
                    lblPriority.Text = bean.Priority.ToString();
                    lblReceiverAccount.Text = bean.ReceiverAccount;
                    lblReceiverAccountType.Text = bean.ReceiverAccountType;

                    lblSender.Text = bean.Sender;
                    lblStatus.Text = bean.EventStatus.ToString();

                    lblTerminalName.Text = bean.TerminalFlag;

                }
            }
        }
    }
}
